#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
#include <QGridLayout>
#include <QVBoxLayout>

#include "mylable.h"

class LoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LoginWidget(QWidget *parent = nullptr);

    void jsonPost();

    QPoint mousePoint;
    bool flag;

    void mousePressEvent(QMouseEvent* event);
    void mouseMoveEvent(QMouseEvent* event);
    void mouseReleaseEvent(QMouseEvent *);



protected:
//    void paintEvent(QPaintEvent *);

signals:
    void loginSign();
    void loginSign(QString);
    void closeWinSign();

public slots:
    void sendSlot();//发送登录槽函数,qt5普通公共函数就行
    void closeWin();//发送关闭信号的槽函数
    void hideWin();//隐藏窗口

private:

    QPushButton *loginButton;//登录按钮
    QLabel *nameLabel;//登录账号名称
    QLabel *passwordLable;//登录密码名称
    QLineEdit *nameEdit;//账号输入框
    QLineEdit *passwordEdit;//密码输入框
    QGridLayout *loginLayout;//登录框部分布局
    QGridLayout *mainLayout; //整体布局

    //MyLable *closeLoginLable;//关闭按钮

    QString tokenValue; //全局变量token值
    bool setToken(QString token);
    QString getToken();//获取Token

    QString name;//账号名
    QString password;//密码


};

#endif // LOGINWIDGET_H
